package openGLTest.code;

import android.content.Context;
import android.graphics.Color;
import android.view.SurfaceHolder;
import android.view.SurfaceView;

public class GLView extends SurfaceView implements SurfaceHolder.Callback{
	
	private GLThread myGLtread;

	public GLView(Context context) {
		super(context);

		getHolder().addCallback(this);
		getHolder().setType(SurfaceHolder.SURFACE_TYPE_GPU);
	}

	@Override
	public void surfaceChanged(SurfaceHolder holder, int format, int width,
			int height) {

		
	}

	@Override
	public void surfaceCreated(SurfaceHolder holder) {

		this.myGLtread = new GLThread(this);
		this.myGLtread.start();
	}

	@Override
	public void surfaceDestroyed(SurfaceHolder holder) {

		this.myGLtread.stop();
		this.myGLtread = null;
	}

}
